package ejT5;

import java.util.Scanner;

public class Ej04b {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);

		System.out.print("Introduce n: ");
		int n = sc.nextInt();		
		int num = n;
		
		while (longitud(num) > 1) {
			int acc = 0;
			while (num > 0) {
				acc += num % 10;
				num /= 10;
			}

			if (longitud(acc) > 1) {
				
			} else {
				break;
			}
		}

	}
	
	private static int longitud(int numero) {
		int sol = 0;
		while (numero > 0) {
			numero /= 10;
			sol++;
		}

		return sol;
	}

}
